package com.example.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * Created by mengdexuan on 2017/3/1 9:52.
 */
@Component
@ConfigurationProperties(prefix = "author")
@PropertySource("classpath:config/author.properties") //若属性在默认的 application.properties 中则不需要此注解
public class Author {
	public Author() {
		super();
	}

	private String name;
	private Integer age;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Override
	public String toString() {
		return "Author{" +
				"name='" + name + '\'' +
				", age=" + age +
				'}';
	}
}
